﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace vue
{
    public partial class Fenetre_de_confirmation : Form
    {
        private bool reponse;
        public Fenetre_de_confirmation()
        {
            reponse = false;
            InitializeComponent();
            question.AutoSize = true;
            pictureBox1.BackgroundImage = global::projet_PAN.Properties.Resources.confirmation;
            this.Refresh();
        }

        private void Fenetre_de_confirmation_Load(object sender, EventArgs e)
        {

        }

        private void Oui_Click(object sender, EventArgs e)
        {
            reponse = true;
            Close();
        }

        private void Non_Click(object sender, EventArgs e)
        {
            reponse = false;
            Close();
        }

        public static bool confirmation(string question)
        {
            Fenetre_de_confirmation fen = new Fenetre_de_confirmation();
            fen.question.Text = question;

            if (fen.ShowDialog() != DialogResult.OK)
            {
                return fen.reponse;
            }

            return false;
        }
    }
}
